# encoding:utf-8

import requests
import base64

request_url = "http://localhost:19951/captcha/v1"
# 二进制方式打开图片文件
f = open('C:/Users/WJG/Desktop/verifyCode/LucidaSans/2ahfy_675ae70a7bd3478d877e56e25b22ac91.jpg', 'rb')
img = base64.b64encode(f.read()).decode()

params = {"image":img}
request_url = request_url
headers = {'content-type': 'application/json'}
response = requests.post(request_url, json=params, headers=headers)
if response:
    print (response.json())